<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/FCKeditor.tld" prefix="fck" %>
<%@page import="java.util.*,model.*,util.*,control.*,java.text.*"%>
<%@ taglib uri="/WEB-INF/displaytag.tld" prefix="display"%>
<!DOCTYPE html>
<html>
<head>
    <title>查看历史纪录</title>
    <meta charset="utf-8"/>
    <script  src='../../js/core.js'></script>
    <link type="text/css" rel='stylesheet' href="../../css/info.css"/>
</head>
<body>
            <%
           /*
           *验证权限
           *author 宋智洋
           *data 2011-11-26
           *update 胡瑾
           *data 2011-12-01
           *增加了userId
           */
			String flag = (String)session.getAttribute("flag");
			String userId = (String)session.getAttribute("userId");
			int studentId = Integer.parseInt(userId);
						
			if (flag != "student"|| flag==null )
			{
				%>
<script language="javascript">
				     alert("您没有学生权限,请重新登录"); window.location.href="../../index.jsp";
				    </script>
            <%
				
			}else{
				Student student = new Student();
				StudentControl sc = new StudentControl();
				student = sc.GetStudent(studentId);
				//out.print("<p>"+student.getStudentName()+"   欢迎您</p>");
			}
           %>
           
          <%
		int k = 0;
		request.setCharacterEncoding("utf-8");
		int pages = ParamUtil.getInt(request,"pages",1);
		int rowsPerPage = ParamUtil.getInt(request,"pageSize",20);
	    Answerlog answerlog = new Answerlog();
	   // Answerlog answerlog2 = new Answerlog();
		AnswerlogControl alc = new AnswerlogControl();
	
		List<Answerlog>list = new ArrayList<Answerlog>();
		list = (List)alc.GetAnswerlog();

%>
<div id="page">
    <header class="header">
        <p class="title">欢迎您注册CAT测评系统</p>
    </header>
    <section class="main">
        <form action="problem_history_list.jsp" method = "post" name="form" >
        	<p>请选择时间:&nbsp;&nbsp;
          <select  class='w340' name="testTime">
				<%
				        /*判重
				        *陈星
						*2011-12-08
						*/
						others o = new others();
						//System.out.println("begin");
						o.InitVtr();
						for(int i = 0; i<list.size();i++)
						{
							answerlog = list.get(i);
							String tmpStr = answerlog.getTestTime();
							int tmp = o.hashStringToInt(tmpStr);
							boolean IsOk = o.InsertVtr(tmp, tmpStr);
							if(IsOk == true &&answerlog.getStudentId() == studentId) {
				%>
				               <option value="<%=answerlog.getTestTime()%>"><%=answerlog.getTestTime() %></option>
				               <%
							}//if
					    } //for
				%>
    </select></p>
          <p><input type="submit" class="btns fl br3"  value="确   定"/>
          <input type="button" onclick="javascript:window.history.go(-1)" class="btns fr br3 mr100"value="返   回"/>
          </p>
          
        </form>
    </section>
    <footer class="footer"><small>© 2012 Nenu</small></footer>
</html>

